<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <!-- <RouterView /> -->
  <div class="btn">
    <span class="btnList">
      <RouterLink to="/Home" active-class="active">首页</RouterLink>
    </span>
    <span class="btnList">
      <RouterLink to="/News" active-class="active">新闻</RouterLink>
    </span>
    <!--to用于跳转对应组件，active-class选中的切换样式-->
    <span class="btnList">
      <RouterLink to="/About" active-class="active">关于</RouterLink>
    </span>
  </div>
  <!-- 主题展示部分 -->
  <div class="main-content">
    <!-- 此处展示各种组件，根据路径展示对应组件  -->
    <RouterView></RouterView>
  </div>
</template>

<style scoped>
/* 移动端 */
@media (min-width: 1024px) {}

/* pc端 */
@media (max-width: 1024px) {}

/* 通用样式 */
div {
  display: block;
}
.btn{
  display: flex;align-items: center;justify-content: space-around;margin: 0 auto;
}

.main-content {
  margin: 0 auto;
  margin-top: 30px;
  border-radius: 10px;
  width: 90%;
  min-height: 400px;
  border: 1px solid;
}

.active {
  background-color: #64967E;
  color: #ffc268;
  font-weight: 800;
  text-shadow: 0 0 1px black;
  font-family: 微软雅黑;
}

a {
  text-decoration: none;
  display: block;
  text-align: center;
  width: 90px;
  line-height: 40px;
  border-radius: 10px;
  background-color: gray;
  text-decoration: none;
  color: white;
  font-size: 18px;
  letter-spacing: 5px;
  font-weight: 800;
}
</style>
